package com.gupao.gupaoeduvippattern.javaBase.thread.threadLocal2;

/**
 * @author Administrator
 * @date 2020-12-08 12:30
 */
public class QueryUtil {

    private String selectType;

    private int number;

    public String getSelectType() {
        return selectType;
    }

    public void setSelectType(String selectType) {
        this.selectType = selectType;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public QueryUtil(String selectType, int number){
        this.selectType = selectType;
        this.number = number;
    }

    public QueryUtil selectData(QueryUtil queryUtil){
        String selectType = queryUtil.getSelectType();

        int num = (int) (Math.random()*100);
        QueryUtil qu = new QueryUtil("1", num);
        System.out.println(Thread.currentThread().getName()+"线程值==>" + qu);

        return qu;
    }

    @Override
    public String toString() {
        return "QueryUtil{" +
                "selectType='" + selectType + '\'' +
                ", number=" + number +
                '}';
    }
}
